<div class="row-fluid" th:fragment="page">
    <div class="span6" th:if="${pi.pages &gt; 0}"
         th:with="beginNo=${pi.pages - pi.pageNum &lt; 4 &amp;&amp; pi.pages &gt; 9 ? pi.pages - 6 : (pi.pageNum &gt; 5 &amp;&amp; pi.pages &gt; 9 ? pi.pageNum - 2 : 1)}, endNo=${pi.pageNum &lt; 5 &amp;&amp; pi.pages &gt; 9 ? 7 : ((pi.pages &gt; 9) &amp;&amp; ((pi.pages - pi.pageNum) &gt; 4) ? pi.pageNum + 2 : pi.pages)}">
        <div class="page_list">
            <div class="p_l">
                <div id="page_iwymb">
                    <span class="disabled_c" th:if="${pi.pageNum &lt; 2}"><u></u>上一页</span>
                    <a th:onclick="'javascript:pagechange(' + ${pi.pageNum - 1} + ')'" title="上一页"
                       th:if="${pi.pageNum &gt;= 2}"><u></u>上一页</a>
                    <!--第一页-->
                    <a onclick="pagechange(1)" title="第1页" th:if="${beginNo == 2}"><u></u>1</a>
                    <span th:if="${beginNo &gt; 2}"><a onclick="pagechange(1)" title="第1页"><u></u>1</a><span
                            class="disabled_c"><u></u>...</span></span>
                    <!--中间的页码-->
                    <div th:each="i : ${#numbers.sequence(beginNo, endNo)}">
                        <span class="current" th:if="${i == pi.pageNum}"
                              th:utext="'&lt;u&gt;&lt;/u&gt;' + ${i}">123</span>
                        <a th:onclick="'javascript:pagechange(' + ${i} + ')'" th:if="${i != pi.pageNum}"
                           th:title="'第' + ${i} + '页'" th:utext="'&lt;u&gt;&lt;/u&gt;' + ${i}">123</a>
                    </div>
                    <!--最后一页-->
                    <a th:onclick="'javascript:pagechange(' + ${pi.pages} + ')'" th:if="${endNo == pi.pages -1}"
                       th:title="${pi.pages}" th:utext="'&lt;u&gt;&lt;/u&gt;' + ${pi.pages}">123</a>
                    <span th:if="${endNo &lt; pi.pages -1}"><span class="disabled_c"><u></u>...</span><a
                            th:onclick="'javascript:pagechange(' + ${pi.pages} + ')'" th:title="${pi.pages}"
                            th:utext="'&lt;u&gt;&lt;/u&gt;' + ${pi.pages}">123</a></span>
                    <!--后一页-->
                    <span class="disabled_c" th:if="${pi.pageNum == pi.pages}"><u></u>下一页</span>
                    <a th:onclick="'javascript:pagechange(' + ${pi.pageNum+1} + ')'" title="后一页"
                       th:if="${pi.pageNum != pi.pages}"><u></u>后一页</a>
                </div>
            </div>
        </div>
    </div>
    <div class="span6">
        <div class="page_select" data-th-if="${pi.pages gt 1}">
            每页
            <select id="pageSize" name="pageSize" th:onchange="'pagechange(1);'" title="">
                <option value="5" th:selected="${pi.pageSize} == 5">5</option>
                <option value="10" th:selected="${pi.pageSize} == 10">10</option>
                <option value="20" th:selected="${pi.pageSize} == 20">20</option>
                <option value="30" th:selected="${pi.pageSize} == 30">30</option>
                <option value="40" th:selected="${pi.pageSize} == 40">40</option>
            </select> 条&nbsp;共
            <span th:text="${pi.total}"></span>条&nbsp;页码:
            <select id="pageIndex" name="pageIndex" th:onchange="'pagechange(this.value);'" th:field="*{pageIndex}"
                    title="">
                <option th:each="page : ${#numbers.sequence(1, pi.pages)}" th:value="${page}" th:text="${page}">1
                </option>
            </select>/
            <span th:text="${pi.pages}">10</span>
        </div>
    </div>
</div>